package com.auxgroup.hr.front.service.process.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

import com.auxgroup.hr.front.dao.domain.PsCWfDmcDtl;
import com.auxgroup.hr.front.dao.repository.PsCWfDmcDtlRepository;
import com.auxgroup.hr.front.service.process.WfDmcDtlService;

/** 
 * @author wangchangyun
 * @version 创建时间：180603 
 * 社保公积金service
 */
@Service("wfDmcDtlService")
public class WfDmcDtlServiceImpl implements WfDmcDtlService {
	private static final Logger logger = LoggerFactory.getLogger(WfDmcDtlServiceImpl.class);
	
	@Autowired
	private PsCWfDmcDtlRepository PsCWfDmcDtlRepository;


	@Override
	public PsCWfDmcDtl getWfDmcDtl(String id) {
		return PsCWfDmcDtlRepository.findOne(id);
	}


	@Override
	public PsCWfDmcDtl save(PsCWfDmcDtl WfDmcDtl) {
		return PsCWfDmcDtlRepository.save(WfDmcDtl);
	}


	@Override
	public Boolean delete(String id) {
		try {
			PsCWfDmcDtlRepository.delete(id);
		} catch (Exception e) {
			logger.error("delete WfDmcDtl error: id={}",id,e);
			return false;
		}
		return true;
	}
	
	
	@Override
	public List<PsCWfDmcDtl> getAll(String cTransactionNbr) {
		PsCWfDmcDtl WfDmcDtl = new PsCWfDmcDtl();
		WfDmcDtl.setcTransactionNbr(cTransactionNbr);
		return PsCWfDmcDtlRepository.findAll(Example.of(WfDmcDtl));
	}


	
	
	
}
